import re
import openpyxl
# from openpyxl import  Workbook
from openpyxl import load_workbook

filename = r''
# wb = Workbook()
# wb.active
book = load_workbook(filename)
book.active
print(book.get_sheet_names)
# book.index(0)
sheet = book['Sheet1']
print('w:'+str(sheet.max_row))
row = sheet.max_row+1
col = sheet.max_column+1
patter = '([\d\.]+) +'
for line in range(1,row):
    for r in range(1,col):
        item =sheet.cell(row=line,column=r)
        print(str(item.value) + str(item.data_type))
        if re.match(patter,str(item.value)):
            c = re.sub(patter,r"\1",str(item.value))
            item.value = c
            item.data_type = 'n'
            print(c)

print(book.save(filename))

